﻿@model OrchardCore.ContentFields.ViewModels.EditNumericFieldViewModel
@using OrchardCore.ContentManagement.Metadata.Models
@using OrchardCore.ContentFields.Settings;

@{
    var settings = Model.PartFieldDefinition.Settings.ToObject<NumericFieldSettings>();
}

@{
    // Morph the current shape to the correct editor shape based on its Editor property
    var shape = Model as OrchardCore.DisplayManagement.IShape;
    shape.Metadata.Alternates.Clear();
    shape.Metadata.Type = "NumericField_Editor";

    if (!String.IsNullOrEmpty(settings.Editor))
    {
        shape.Metadata.Alternates.Add($"NumericField_Editor__{settings.Editor}");
    }
}

@await DisplayAsync(Model)
